#include <stdio.h>
typedef struct EXM
{
    unsigned char head1;
    unsigned char head2;
    unsigned char val;
    unsigned char cksum;
}TYPE;
void val(int input,TYPE *addr)
{
    int i;
    for(i=0;i<4;i++)
    {
        *((unsigned char *)addr + i) = (input >> i * 8);
    }
}
void fun(int a,TYPE *b,void (*f)())
{
    (*f)(a,b);
}
int main(void)
{
    TYPE st = {0};
    int k = 0x1245abcd;
    fun(k,&st,val);
    int i;
    for(i=4;i>=0;i--)
    {
        printf("0x%x\t",*((unsigned char *)&st + i));
    }
    printf("\n");

    return 0;
    
}
